<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ChainETL</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ChainETL</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/etl/std_rb.html">
                etl/std.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ETL.html">
                ETL
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Defines an <a href="ETL.html">ETL</a> chain, i.e. a block in the <a
href="ETL.html">ETL</a> process which triggers the execution of a sequence
of blocks. The chain may be configured in two different ways:
</p>
<ul>
<li>via the <a href="ETL.html">ETL</a> configuration file using the
<tt>block</tt> parameters ( <tt>block0</tt>,<tt>block1</tt> &#8230;)

</li>
<li>programmatically by direct invocations of methods on this class.

</li>
</ul>
<p>
This class wraps a plain array to store the chain sequence, therefore you
may use standard methods to manipulate the chains, such as &lt;&lt;
operator.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000054">b_send</a>&nbsp;&nbsp;
      <a href="#M000045">chain?</a>&nbsp;&nbsp;
      <a href="#M000049">extract</a>&nbsp;&nbsp;
      <a href="#M000046">global_opts=</a>&nbsp;&nbsp;
      <a href="#M000058">handle_block_exception</a>&nbsp;&nbsp;
      <a href="#M000060">is_chain?</a>&nbsp;&nbsp;
      <a href="#M000061">is_mplex?</a>&nbsp;&nbsp;
      <a href="#M000059">is_savepoint?</a>&nbsp;&nbsp;
      <a href="#M000051">load</a>&nbsp;&nbsp;
      <a href="#M000044">new</a>&nbsp;&nbsp;
      <a href="#M000047">props=</a>&nbsp;&nbsp;
      <a href="#M000048">resolve_props</a>&nbsp;&nbsp;
      <a href="#M000053">run_block</a>&nbsp;&nbsp;
      <a href="#M000052">run_chain</a>&nbsp;&nbsp;
      <a href="#M000057">set_step</a>&nbsp;&nbsp;
      <a href="#M000050">transform</a>&nbsp;&nbsp;
      <a href="#M000056">unless_step_over</a>&nbsp;&nbsp;
      <a href="#M000055">while_mplexing</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="Log.html">Log</a></span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">blocks</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc">
The sequence of blocks which compose this chain

</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">phase</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc">
The phase this chain will run. May be one <tt><a
href="ChainETL.html#M000049">extract</a></tt>, <tt><a
href="ChainETL.html#M000050">transform</a></tt> or <tt><a
href="ChainETL.html#M000051">load</a></tt>, or custom ones.

</td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000044" class="method-detail">
        <a name="M000044"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000044.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000044.html');return false;">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Initializes a <a href="ChainETL.html#M000044">new</a> chain. After this
method call, the chain phase is still undefined.
</p>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000045" class="method-detail">
        <a name="M000045"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000045.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000045.html');return false;">
          <span class="method-name">chain?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
A marker method which identifies this block as a chain. This method always
returns <tt>true</tt>
</p>
        </div>
      </div>

      <div id="method-M000049" class="method-detail">
        <a name="M000049"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000049.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000049.html');return false;">
          <span class="method-name">extract</span><span class="method-args">(dto,context)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Runs this chain within the <b><a
href="ChainETL.html#M000049">extract</a></b> phase. This means that the
<tt><a href="ChainETL.html#M000049">extract</a></tt> method will be invoked
on all the blocks composing the chain sequence. Invoking this method
overrides any previously set phase.
</p>
        </div>
      </div>

      <div id="method-M000046" class="method-detail">
        <a name="M000046"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000046.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000046.html');return false;">
          <span class="method-name">global_opts=</span><span class="method-args">(globals)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Receives the global configuration options for the whole <a
href="ETL.html">ETL</a>, instead of only the ones relevant for this chain.
</p>
        </div>
      </div>

      <div id="method-M000051" class="method-detail">
        <a name="M000051"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000051.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000051.html');return false;">
          <span class="method-name">load</span><span class="method-args">(dto,context)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Runs this chain within the <b><a href="ChainETL.html#M000051">load</a></b>
phase. This means that the <tt><a
href="ChainETL.html#M000051">load</a></tt> method will be invoked on all
the blocks composing the chain sequence. Invoking this method overrides any
previously set phase.
</p>
        </div>
      </div>

      <div id="method-M000047" class="method-detail">
        <a name="M000047"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000047.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000047.html');return false;">
          <span class="method-name">props=</span><span class="method-args">(chain_config)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Defines the properties of this chain. The properties also contain the chain
sequence definition. Refer to the documentation associated to configuration
files for further info on how to define a proper chain sequence.
</p>
        </div>
      </div>

      <div id="method-M000048" class="method-detail">
        <a name="M000048"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000048.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000048.html');return false;">
          <span class="method-name">resolve_props</span><span class="method-args">(p)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Resolve a set of properties in case it points to another one. In order to
define a pointer, the set of properties must contain the <tt>refer_to</tt>
key and the name of the referred set as value.
</p>
        </div>
      </div>

      <div id="method-M000052" class="method-detail">
        <a name="M000052"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000052.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000052.html');return false;">
          <span class="method-name">run_chain</span><span class="method-args">(dto,context) {|block| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Runs this chain. The chain phase is defined by setting the <tt>phase</tt>
property on this class prior to invoking this method. Phase may be
overriden by passing a block to this method and returning the <a
href="ChainETL.html#M000044">new</a> phase to be used.
</p>
<p>
Chain phase defines which method will be invoked on chain blocks. Standard
phases are <tt><a href="ChainETL.html#M000049">extract</a></tt>, <tt><a
href="ChainETL.html#M000050">transform</a></tt> and <tt><a
href="ChainETL.html#M000051">load</a></tt>, but custom chains may define
their own phases (such as lifecycle phases).
</p>
        </div>
      </div>

      <div id="method-M000050" class="method-detail">
        <a name="M000050"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000050.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000050.html');return false;">
          <span class="method-name">transform</span><span class="method-args">(dto,context)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Runs this chain within the <b><a
href="ChainETL.html#M000050">transform</a></b> phase. This means that the
<tt><a href="ChainETL.html#M000050">transform</a></tt> method will be
invoked on all the blocks composing the chain sequence. Invoking this
method overrides any previously set phase.
</p>
        </div>
      </div>

      <h3 class="section-bar">Protected Instance methods</h3>

      <div id="method-M000054" class="method-detail">
        <a name="M000054"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000054.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000054.html');return false;">
          <span class="method-name">b_send</span><span class="method-args">(block,ctx)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Delegates execution to the current block. This method is the last one
before passing the buck to the block. At this point multiplexing, savepoint
recovery and every other precondition has already been resolved.
</p>
        </div>
      </div>

      <div id="method-M000058" class="method-detail">
        <a name="M000058"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000058.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000058.html');return false;">
          <span class="method-name">handle_block_exception</span><span class="method-args">(context,exc)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
handles exceptions which may occur while executing a block
</p>
        </div>
      </div>

      <div id="method-M000060" class="method-detail">
        <a name="M000060"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000060.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000060.html');return false;">
          <span class="method-name">is_chain?</span><span class="method-args">(block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Checks whether the given block is a chain block or not
</p>
        </div>
      </div>

      <div id="method-M000061" class="method-detail">
        <a name="M000061"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000061.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000061.html');return false;">
          <span class="method-name">is_mplex?</span><span class="method-args">(dto)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Checks whether the given block is a <a
href="MultiplexDTO.html">MultiplexDTO</a> or not
</p>
        </div>
      </div>

      <div id="method-M000059" class="method-detail">
        <a name="M000059"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000059.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000059.html');return false;">
          <span class="method-name">is_savepoint?</span><span class="method-args">(block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Checks whether the given block is a savepoint block or not
</p>
        </div>
      </div>

      <div id="method-M000053" class="method-detail">
        <a name="M000053"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000053.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000053.html');return false;">
          <span class="method-name">run_block</span><span class="method-args">(block, dto, context)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Runs (or skips if needed) the next block of the chain and moves the chain
one step forward. Skipping may occur when a non-nil initial step has been
defined in the configuration file.
</p>
        </div>
      </div>

      <div id="method-M000057" class="method-detail">
        <a name="M000057"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000057.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000057.html');return false;">
          <span class="method-name">set_step</span><span class="method-args">(context, stepname)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
sets the current step name
</p>
        </div>
      </div>

      <div id="method-M000056" class="method-detail">
        <a name="M000056"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000056.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000056.html');return false;">
          <span class="method-name">unless_step_over</span><span class="method-args">(block, ctx) {|block, ctx| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Executes the block passed as parameter unless skipping is needed.
</p>
        </div>
      </div>

      <div id="method-M000055" class="method-detail">
        <a name="M000055"></a>

        <div class="method-heading">
          <a href="ChainETL.src/M000055.html" target="Code" class="method-signature"
            onclick="popupCode('ChainETL.src/M000055.html');return false;">
          <span class="method-name">while_mplexing</span><span class="method-args">(ctx, block) {|| ...}</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
handles multiplexed DTOs and subsequently yields to the code block passed
as parameter for all the DTOs which compose a multiplexed one.
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>